home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Business Assistant
/
Business Assistant.iso
/
acctg
/
hseacctg
/
jrnlarch.pf3
< prev
next >
Wrap
Text File
|
1987-06-29
|
4KB
|
132 lines
' ROUTINE TO PURGE RECORDS FROM journal AND PLACE THEM INTO jrnlarch
' -------------------------------------------------------------------------
quiet on
singlestep off
' ----------------------input-screen accepts cutoff date-------------------
label re.try
let %1 = upper("abort")
Input-screen load jrnlarch
menu clear box 1 1 21 80 7 0
menu print 10 20 7 0 Processing . . . One moment Please.
repaint off
if (%1 = upper("abort")) or (len("%1") = 0) then jump all.done
let $cutoff = "%1"
if match(mid($cutoff,3,1),"/") = 0 then jump inv.date
if match($cutoff,"/") <> 3 or match($cutoff,"/",4) <> 6 then jump inv.date
' ---------------------screen display with start time----------------------
repaint on
menu clear box 1 1 21 80 7 0
menu draw box 9 19 11 55 7 0
menu print 10 20 7 0 Processing . . . One moment Please.
let %2 = left(time,5)|right(time,1)
menu print 5 17 7 0 This process can take up to fifteen minutes
menu print 6 17 7 0 depending upon the number of records in the file.
menu print 17 30 7 0 Start Time: %2
menu print 18 30 7 0 Cutoff Date: %1
repaint off
' --------------------get rid of recon window and screen-------------------
goto window 2
unload screen recon
close
' -----------------load jrnlarch-------------------------------------------
split horizontal 13 2
goto window 2
load JRNLARCH screen standard
' -----------------select records to be archived, display count------------
goto window 1
query predefined ARCHIVE index ARCHIVE
order index ARCHIVE
if records = 0 then jump no.records
let %2 = records
menu print 19 20 7 0 Number of Records to Archive: %2
' -------------------write all archive records to arch.det-----------------
GOTO WINDOW 1
write all [1|13] smart arch.det
' ----this is used to delete the first record from arch.det (titles)-------
goto window 2
let %3 = records + 1
' ---------------------read the records from arch.det into jrnlarch--------
read smart arch.det fields [1|13]
file erase arch.det
' ------------------goto first new record and delete it--------------------
goto record rec-number %3
delete
unload file jrnlarch
close
utilities purge jrnlarch
' ------------------rebuild keys after purge-------------------------------
load jrnlarch screen standard
key organize all
unload file jrnlarch
' ----while journal is still indexed w/ archive, get bal forward amts------
goto window 1
goto file journal screen enter
order index archive
write summarized predefined balforwd smart arch.sum
' -------------read partial bal forward records into journal----------------------
order sequential
let %3 = records + 1
read smart arch.sum fields [1;5]
file erase arch.sum
' -------------delete the first bal forward record using %3 again----------
goto record rec-number %3
delete
' --------------fill in the gaps of the partial bal forward records--------
let %3 = %3 + 1
while %3 <= records
goto record rec-number %3
let [2] = "DEP"
let [3] = today
let [4] = "BALANCE FORWARD DURING ARCHIVE"
let [6] = ""
let [7] = ""
let [8] = today
let [9] = today
let %3 = %3 + 1
endwhile
' -------------get rid of the deleted records------------------------------
order index archive
goto record rec-number 1
delete
while record < records
goto record next
delete
endwhile
unload file journal
utilities purge journal
' ---------------rebuild keys after purge----------------------------------
load journal screen standard
key organize all
label all.done
unload all
close
end
' ------------------misc routines------------------------------------------
label inv.date
beep
message Invalid date. Press any key to retry.....
jump re.try
label no.records
beep
message No records transferred to archive.